package com.hls.demo;

import java.util.List;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.hls.dao.UserDao;
import com.hls.entity.UserInfo;


public class Start {
    public static void main(String[] args) {
        
        BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserInfo userinfo= new UserInfo();
        
        UserDao userDao = (UserDao) factory.getBean("userDao");
        UserInfo userInfo = userDao.select(1);
        
        System.out.println(userInfo);
        userDao.update("test", 1);
        
        UserInfo userInforet = userDao.select(1);
        System.out.println(userInforet);
        
        //userDao.deleteById(1);
        
        List<UserInfo> list = userDao.getUserList();
        for(UserInfo item : list)
        {
            System.out.println(item);
        }
    }
}
